c# foreach enum

105

c# foreach enum -

enum Foos {
  Foo,
  Bar,
}

foreach(Foos val in Enum.GetValues(typeof(Foos))) {
  //Do whatever with the value :D
}

enum foreach -

foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit)))
{
}

c# foreach enum -

foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit)))
{
}

Comments

Submit
0 Comments